package net.spatula.tally_ho.model;

/* Copyright 2006 Nicklas R Johnson
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */

import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.OneToOne;
import javax.persistence.JoinColumn;

@Table(name="account_audit")
@Entity
public class AccountAudit implements Serializable {
	@Id
	@Column(name="audit_id")
	private long auditId;

	@Column(name="is_editor")
	private boolean isEditor;

	private String uid;

	private boolean verified;

	@Column(name="change_summary")
	private String changeSummary;

	private long version;

	@Column(name="premium_until")
	private Date premiumUntil;

	private String username;

	@Column(name="object_id")
	private long objectId;

	@Column(name="password_answer")
	private String passwordAnswer;

	@Column(name="is_owner")
	private boolean isOwner;

	@Column(name="change_type")
	private char changeType;

	@Column(name="password_question")
	private String passwordQuestion;

	@Column(name="is_admin")
	private boolean isAdmin;

	private String location;

	private String email;

	@Column(name="crypt_password")
	private String cryptPassword;

	@Column(name="change_time")
	private Timestamp changeTime;

	@Column(name="is_moderator")
	private boolean isModerator;

	@Column(name="create_date")
	private Timestamp createDate;

	@Column(name="is_okay_to_post")
	private boolean isOkayToPost;

	@OneToOne
	@JoinColumn(name="changer", referencedColumnName = "object_id", insertable = false, updatable = false)
	private Account changer;

	private static final long serialVersionUID = 1L;

	public AccountAudit() {
		super();
	}

	public long getAuditId() {
		return this.auditId;
	}

	public void setAuditId(long auditId) {
		this.auditId = auditId;
	}

	public String getUid() {
		return this.uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getChangeSummary() {
		return this.changeSummary;
	}

	public void setChangeSummary(String changeSummary) {
		this.changeSummary = changeSummary;
	}

	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	public Date getPremiumUntil() {
		return this.premiumUntil;
	}

	public void setPremiumUntil(Date premiumUntil) {
		this.premiumUntil = premiumUntil;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public long getObjectId() {
		return this.objectId;
	}

	public void setObjectId(long objectId) {
		this.objectId = objectId;
	}

	public String getPasswordAnswer() {
		return this.passwordAnswer;
	}

	public void setPasswordAnswer(String passwordAnswer) {
		this.passwordAnswer = passwordAnswer;
	}

	public String getPasswordQuestion() {
		return this.passwordQuestion;
	}

	public void setPasswordQuestion(String passwordQuestion) {
		this.passwordQuestion = passwordQuestion;
	}

	public String getlocation() {
		return this.location;
	}

	public void setlocation(String location) {
		this.location = location;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCryptPassword() {
		return this.cryptPassword;
	}

	public void setCryptPassword(String cryptPassword) {
		this.cryptPassword = cryptPassword;
	}

	public Timestamp getChangeTime() {
		return this.changeTime;
	}

	public void setChangeTime(Timestamp changeTime) {
		this.changeTime = changeTime;
	}

	public Timestamp getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	public char getChangeType() {
		return changeType;
	}

	public boolean isAdmin() {
		return isAdmin;
	}

	public boolean isEditor() {
		return isEditor;
	}

	public boolean isModerator() {
		return isModerator;
	}

	public boolean isOkayToPost() {
		return isOkayToPost;
	}

	public boolean isOwner() {
		return isOwner;
	}

	public boolean isVerified() {
		return verified;
	}

	public Account getChanger() {
		return this.changer;
	}

	public void setChanger(Account changer) {
		this.changer = changer;
	}

	public void setChangeType(char changeType) {
		this.changeType = changeType;
	}

	public void setAdmin(boolean isAdmin) {
		this.isAdmin = isAdmin;
	}

	public void setEditor(boolean isEditor) {
		this.isEditor = isEditor;
	}

	public void setModerator(boolean isModerator) {
		this.isModerator = isModerator;
	}

	public void setOkayToPost(boolean isOkayToPost) {
		this.isOkayToPost = isOkayToPost;
	}

	public void setOwner(boolean isOwner) {
		this.isOwner = isOwner;
	}

	public void setVerified(boolean verified) {
		this.verified = verified;
	}

}
